select * into tuanlt4_customer_low_value from tuanlt4.[AD_HOC].[dbo].[TOI_CUSTOMER]

drop table TBL_CUSTOMER_LOW_VALUE

SELECT A.CIF, A.TOTAL_TOI_2016, A.AVG_TOI_2016, A.CUSTOMER_VALUE, B.BRANCH_ID, B.DAO, B.DAO_NAME, b.CUS_NAME, B.INDUSTRY_NAME,B.INDUSTRY_NAME_EN, B.CUS_OPEN_DATE, '' AS PMBO, '' AS PMBO_NAME
INTO TBL_CUSTOMER_LOW_VALUE
FROM TUANLT4_CUSTOMER_LOW_VALUE A, TBL_CUSTOMER B
WHERE A.CIF = B.CIF COLLATE DATABASE_DEFAULT

update TBL_CUSTOMER_LOW_VALUE 
set AVG_TOI_2016 = 0 
where AVG_TOI_2016 is null

alter table TBL_CUSTOMER_LOW_VALUE add pmbo_name nvarchar(200)

update TBL_CUSTOMER_LOW_VALUE set PMBO_name = ''

select * from TBL_CUSTOMER_LOW_VALUE